package com.gan.simple_init.model.movie.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 新增电影
 *
 * @author gbw
 * @TableName movie
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@HeadStyle(
        // 水平居中
        horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        // 垂直居中
        verticalAlignment = VerticalAlignmentEnum.CENTER,
        // 识别换行符“\n”
        wrapped = BooleanEnum.TRUE
)
@ContentStyle(
        // 水平居中
        horizontalAlignment = HorizontalAlignmentEnum.CENTER,
        // 垂直居中
        verticalAlignment = VerticalAlignmentEnum.CENTER,
        // 识别换行符“\n”
        wrapped = BooleanEnum.TRUE)
@ColumnWidth(17)
public class AddMovieDto implements Serializable {


    /**
     * 电影名
     */
    @ExcelProperty(value = "电影名", index = 0)
    @Size(max = 10, min = 1, message = "电影名称长度必须大于等于1且小于等于10")
    private String title;

    /**
     * 上映日期
     */
    @ExcelProperty(value = "上映日期",index = 1)
    private Date releaseDate;

    /**
     * 导演
     */
    @ExcelProperty(value = "导演",index = 2)
    private String director;

    /**
     * 电影封面
     */
    @ExcelProperty(value = "电影封面",index = 3)
    private String cover;

    /**
     * 主演
     */
    @ExcelProperty(value = "主演",index = 4)
    @ColumnWidth(30)
    private String protagonist;

    /**
     * 标签
     */
    @ExcelProperty(value = "标签",index = 5)
    private String tag;

    /**
     * 时长
     */
    @ExcelProperty(value = "时长",index = 6)
    private String duration;

    /**
     * 语言
     */
    @ExcelProperty(value = "语言",index = 7)
    private String language;

    /**
     * 编剧
     */
    @ExcelProperty(value = "编剧",index = 8)
    private String writer;

    /**
     * 国家
     */
    @ExcelProperty(value = "国家",index = 9)
    @Size(max = 30, message = "国家名称长度不能超过30位")
    private String nation;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}